package com.example.config.queue;


import com.example.queue.QueuesHolder;
import com.example.queue.TestQueue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

 /**
  * @Title: spring-boot-druid
  * @Package com.example.config.queue
  * @Date 2018/5/8下午1:39
  * @Author PX ye
  * @E-mail yepx2013@gmail.com
  * @Company http://www.yiautos.com
  * @Description: 阻塞队列配置
  */
@Configuration
public class QueueConfig {

    @Bean
    @Lazy(value=false)
    public QueuesHolder queuesHolder(){
        QueuesHolder queuesHolder = new QueuesHolder();
        queuesHolder.setQueueSize(10000);

        return queuesHolder;
    }
    @Bean
    @Lazy(value=false)
    public TestQueue testQueue(){
        TestQueue testQueue = new TestQueue();
        testQueue.setQueueName("com.example.queue.TestQueue");

        return testQueue;
    }
}
